<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core" 
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
    <div id="language" style="text-align:right">
        <h:form>
                <h:commandLink action="#{idioma.ptBR()}">#{msgs.portuguese}</h:commandLink> | 
                <h:commandLink action="#{idioma.en()}">#{msgs.english}</h:commandLink>                 
            </h:form>  
    </div>
    <div id="header">
        <h1 class="logo"><a href="#{request.contextPath}/index.xhtml">#{msgs.logo}</a></h1>
        <span class="lc">
        <h:panelGroup rendered="#{empty user}">
            <a href="#" class="login">#{msgs.signin}</a> | <a href="#{request.contextPath}/cadastro.xhtml">#{msgs.register}</a>
        </h:panelGroup>
        <h:panelGroup rendered="#{not empty user}">
            Olá #{user}!<br/>
                <h:form>
                    <p:commandLink value="Sair" action="#{login.logout}" ajax="false">  
                    </p:commandLink>
                </h:form>
            
        </h:panelGroup>
        </span>
        <span id="login">            
            <f:view>
                <h:form>
                    <h:panelGrid columns="2">
                        <h:outputLabel value="#{msgs.user}" for="un"/>
                        <h:inputText id="un" value="#{login.username}"/>
                        <h:outputLabel value="#{msgs.password}" for="pw"/>
                        <h:inputText id="pw" value="#{login.password}"/>
                    </h:panelGrid>
                    <h:commandButton value="#{msgs.submit}" action="#{login.validateLogin}"/>
                </h:form>
            </f:view>

        </span>        
    </div>

    <div id="menu">
        <ul>
            <li class="current_page_item"><a href="#{request.contextPath}">Home</a></li>
            <li><a href="#{request.contextPath}/jogos.xhtml">#{msgs.games}</a></li> <!-- busca todos os jogos -->
            <li><a href="#{request.contextPath}">#{msgs.prices}</a></li>
            <li><a href="#{request.contextPath}">#{msgs.deliver}</a></li>
            <li><a href="#{request.contextPath}">#{msgs.about}</a></li>
            <li><a href="#{request.contextPath}">#{msgs.contact}</a></li>            
        </ul>
    </div>
    <div style="clear: both;">&nbsp;</div>

</html>
